<?php

/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model admin\models\AuthItem */
use dosamigos\datepicker\DatePicker;

$this->title = '客户管理';
$this->params['breadcrumbs'][] = $this->title;
$arr = [
    '猴','鸡','狗','猪','鼠','牛','虎','兔','龙','蛇','马','羊'
];
$sexArr = ['男'=>'男','女'=>'女'];
?>
    <div class="wrapper wrapper-content animated">
        <div class="ibox-content">
            <p>
                <a href="#" data-toggle="modal" data-target="#myDialog" data-data="add">
                    <button class="btn btn-info" ><li class="fa fa-user-plus"></li> 添加客户</button>
                </a>
            </p>
            <input name="manager_page" value="1" type="hidden">
                    <div class="row" style="margin-bottom: 5px">
                        <div class="col-sm-2">
                            <div class="input-group">
                                <span class="input-group-addon" style="background-color: #21b9bb;border-color: #21b9bb;color: #FFF;">姓名</span>
                                <input autocomplete="off" style="border-radius: 4px;" class="form-control input-sm" id="searchName" type="text"
                                       value="<?=empty($searchArr) ? '':(empty($searchArr['mi_name'])? '':$searchArr['mi_name']) ?>"
                                    >
                                <div class="input-group-btn">
                                    <button style="display: none;" type="button" class="btn btn-default dropdown-toggle" data-toggle="">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="input-group">
                                <span class="input-group-addon" style="background-color: #21b9bb;border-color: #21b9bb;color: #FFF">手机号</span>
                                <input autocomplete="off" style="border-radius: 4px;" class="form-control input-sm" id="searchPhone" type="text"
                                       value="<?=empty($searchArr) ? '':(empty($searchArr['me_phone'])? '':$searchArr['me_phone']) ?>"
                                    >
                                <div class="input-group-btn">
                                    <button style="display: none;" type="button" class="btn btn-default dropdown-toggle" data-toggle="">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="input-group">
                                <span class="input-group-addon" style="background-color: #21b9bb;border-color: #21b9bb;color: #FFF"> QQ </span>
                                <input autocomplete="off" style="border-radius: 4px;" class="form-control input-sm" id="searchQQ" type="text"
                                       value="<?=empty($searchArr) ? '':(empty($searchArr['me_qq'])? '':$searchArr['me_qq']) ?>"
                                    >
                                <div class="input-group-btn">
                                    <button style="display: none;" type="button" class="btn btn-default dropdown-toggle" data-toggle="">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="input-group">
                                <span class="input-group-addon" style="background-color: #21b9bb;border-color: #21b9bb;color: #FFF">身份证</span>
                                <input autocomplete="off" style="border-radius: 4px;" class="form-control input-sm" id="searchCard" type="text"
                                       value="<?=empty($searchArr) ? '':(empty($searchArr['mi_cardid'])? '':$searchArr['mi_cardid']) ?>"
                                    >
                                <div class="input-group-btn">
                                    <button style="display: none;" type="button" class="btn btn-default dropdown-toggle" data-toggle="">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-2" style="width: 200px;">
                            <div class="input-group">
                                <span class="input-group-addon" style="background-color: #21b9bb;border-color: #21b9bb;color: #FFF">年龄</span>
                                <input autocomplete="off" style="border-radius: 4px;width: 50px;border: 1px solid #e5e6e7" class="input-sm" id="searchminage" type="text"
                                       value="<?=empty($fieldArr) ? '':(empty($fieldArr['minage'])? '':$fieldArr['minage']) ?>"
                                >-<input autocomplete="off" style="border-radius: 4px;width: 50px;border: 1px solid #e5e6e7" class="input-sm" id="searchmaxage" type="text"
                                         value="<?=empty($fieldArr) ? '':(empty($fieldArr['maxage'])? '':$fieldArr['maxage']) ?>"
                                >
                            </div>
                        </div>
                        <div class="col-sm-1">
                            <?= Html::dropDownList('sex', empty($searchArr) ? '':(empty($searchArr['mi_sex'])? '':$searchArr['mi_sex']), $sexArr,['prompt' => '性别', 'class' => 'form-control input-sm','style'=>'font-size:13px']) ?>
                        </div>
                    </div>
            <div class="row" style="margin-bottom: 5px">
                <div class="col-sm-5">
                    <div class="col-sm-5" style="padding-left: 0px">
                        <div class="input-group">
                        <span class="input-group-addon" style="background-color: #21b9bb;border-color: #21b9bb;color: #FFF">地区</span>
                        <?= Html::dropDownList('province', empty($fieldArr) ? '':(empty($fieldArr['province'])? '':$fieldArr['province']), $privinceArr,['prompt' => '选择省', 'class' => 'form-control input-sm','style'=>'font-size:13px']) ?>
                        </div>
                    </div>
                    <div class="col-sm-3">
                        <?= Html::dropDownList('city', empty($fieldArr) ? '':(empty($fieldArr['city'])? '':$fieldArr['city']), $cityArr,['prompt' => empty($cityArr) ?'先选省':'选择市', 'class' => 'form-control input-sm','style'=>'font-size:13px','disabled'=>empty($cityArr) ? true:false]) ?>
                    </div>
                    <div class="col-sm-3">
                        <?= Html::dropDownList('district', empty($fieldArr) ? '':(empty($fieldArr['district']) ? '':$fieldArr['district']), $districtArr,['prompt' => empty($districtArr) ?'先选市':'选择区', 'class' => 'form-control input-sm','style'=>'font-size:13px','disabled'=>empty($districtArr) ? true:false]) ?>
                    </div>
                </div>
                <div class="col-sm-1">
                    <input id="searchIsowner" value="" type="checkbox" style="border: 1px solid #e5e6e7" <?=!empty($fieldArr)&&$fieldArr['md_isowner']==2 ? 'checked':'' ?> > <span style="margin-top: 5px;">有 房</span>
                </div>
                <div class="col-sm-1">
                    <input id="searchHascar" value="" type="checkbox" style="border: 1px solid #e5e6e7" <?=!empty($fieldArr)&&$fieldArr['md_hascar']==2 ? 'checked':'' ?>> <span style="margin-top: 5px;">有 车</span>
                </div>
                <div class="col-sm-2">
                    <?= Html::dropDownList('edu', empty($fieldArr) ? '':(empty($fieldArr['mi_edu'])? '':$fieldArr['mi_edu']), $eduArr,['prompt' => '请选择学历', 'class' => 'form-control input-sm','style'=>'font-size:13px']) ?>
                </div>
                <div class="col-sm-2">
                    <button class="btn btn-info btn-sm" id="searchUser"><li class="fa fa-search"></li>搜 索</button>
                    <button class="btn btn-info btn-sm" id="emptySearch"><li class="fa fa-refresh"></li>清 空</button>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                        <input name="user_page" value="1" type="hidden">
                            <div class="table-responsive">
                                <table class="table table-stripped">
                                    <thead>
                                    <tr>
                                        <th  data-toggle="false">编号</th>
                                        <th>姓名</th>
                                        <th>性别</th>
                                        <th>年龄</th>
                                        <th>身高</th>
                                        <th>体重</th>
                                        <th>出生年月</th>
                                        <th>属相</th>
                                        <th>籍贯</th>
                                        <th>学历</th>
                                        <th>健康状态</th>
                                        <th>婚姻状态</th>
                                        <th>状态</th>
                                        <th>录入时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php foreach($users as $user):?>
                                        <tr>
                                            <td id="mi_id"><?=$user['mi_id'] ?></td>
                                            <td>
                                                <b style="cursor: pointer;color: #3300aa" id="name"><?=$user['mi_name'] ?></b>
                                            </td>
                                            <td><?=$user['mi_sex']=='男' ? '<i class="fa fa-mars" style="color: #0044cc"></i>':
                                                    ($user['mi_sex']=='女' ? '<i class="fa fa-venus" style="color: #cd0a0a"></i>':
                                                        '<i class="fa fa-genderless" style="color: grey"></i>') ?></td>
                                            <td><?=$user['mi_age'] ?></td>
                                            <td><?=empty($user['mi_height']) ? '未知':$user['mi_height'].'cm' ?></td>
                                            <td><?=empty($user['mi_weight']) ? '未知':$user['mi_weight'].'kg' ?></td>
                                            <td><?=empty($user['mi_birth']) ? '未知':$user['mi_birth'] ?></td>
                                            <td><?=empty($user['mi_zodiac']) ? '未知':$user['mi_zodiac'] ?></td>
                                            <td><?=empty($user['mi_root']) ? '未知':str_replace(';','',$user['mi_root']) ?></td>
                                            <td><?=empty($user['mi_edu']) ? '未知':$user['mi_edu'] ?></td>
                                            <td><?=(empty($user['healths'])||empty($user['healths']['mh_state'])) ? '未知':$user['healths']['mh_state']  ?></td>
                                            <td><?=(empty($user['details'])||empty($user['details']['md_marry'])) ? '未知':$user['details']['md_marry']  ?></td>
                                            <td><?php
                                                if($user['mi_status']==0){
                                                    echo '<p><span class="label label-default"><i class="fa fa-times"></i> 已 删</span>
                        </p>';
                                                }else{
                                                    echo '<p><span class="label label-info"><i class="fa fa-check"></i> 正 常</span>
                        </p>';
                                                }
                                                ?>
                                            </td>
                                            <td><?=$user['created_time'] ?></td>
                                            <td>
                                                <a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['user/view','id'=>$user['mi_id']])?>">
                                                    <i class="fa fa-eye"></i> 查看
                                                </a>
                                                <?php
                                                if($user['mi_status']<>0&&Yii::$app->user->identity->ma_type<3){
                                                    ?>
                                                    <a class="btn btn-default btn-xs" id="user_del">
                                                        <i class="fa fa-trash-o"></i>
                                                        删除
                                                    </a>
                                                    <?php
                                                }elseif($user['mi_status']==0&&Yii::$app->user->identity->ma_type<3){
                                                    ?>
                                                    <a href="#" class="btn btn-success btn-xs" id="user_recover">
                                                        <i class="fa fa-undo"></i>
                                                        恢复
                                                    </a>
                                                    <?php
                                                }
                                                ?>
                                            </td>
                                        </tr>
                                        <tr id="user_detail<?=$user['mi_id'] ?>" style="display: none;">
                                            <td colspan="14">
                                            <div class="col-sm-12">
                                            <div class="col-sm-6">
                                                <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">身份证号：</label><i style="color: #0b58a2;margin-left: 10px" class="fa fa-user"></i> &nbsp;<?=empty($user['mi_cardid']) ? '未知':$user['mi_cardid'] ?>
                                            <label style="color: #0b58a2;margin-left: 10px">视 力：</label><i style="color: #0b58a2;margin-left: 10px" class="fa fa-eye"></i> &nbsp;<?=empty($user['mi_sight']) ? '未知':$user['mi_sight'] ?>
                                            </div>
                                            <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">联系方式：</label>
                                            <i style="color: #0b58a2;margin-left: 5px" class="fa fa-mobile"></i> &nbsp;<?=empty($user['extras']['me_phone']) ? '未知':$user['extras']['me_phone'] ?>
                                            <i style="color: #0b58a2;margin-left: 10px" class="fa fa-qq"></i> &nbsp;<?=empty($user['extras']['me_qq']) ? '未知':$user['extras']['me_qq'] ?>
                                            <i style="color: #0b58a2;margin-left: 10px" class="fa fa-wechat"></i> &nbsp;<?=empty($user['extras']['me_wx']) ? '未知':$user['extras']['me_wx'] ?>
                                            </div>
                                            <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">现居地址：</label><i style="color: #0b58a2;margin-left: 10px" class="fa fa-map-marker"></i> &nbsp;<?=empty($user['extras']['me_postion'])&&empty($user['extras']['me_address']) ? '未知':str_replace(';','',$user['extras']['me_postion']).$user['extras']['me_address'] ?>
                                            </div>
                                                <div class="row">
                                                <label style="color: #0b58a2;margin-left: 10px">住房性质：</label> &nbsp;<?=empty($user['extras']['me_livetype']) ? '未知':$user['extras']['me_livetype'] ?>
                                            <label style="color: #0b58a2;margin-left: 10px">居住环境：</label> &nbsp;<?=empty($user['extras']['me_env']) ? '未知':$user['extras']['me_env'] ?>
                                            </div>
                                            <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">工作单位：</label> &nbsp;<?=empty($user['details']['md_work']) ? '未知':$user['details']['md_work'] ?>
                                            <label style="color: #0b58a2;margin-left: 10px">月 薪：</label><i style="color: #0b58a2;margin-left: 5px" class="fa fa-rmb"></i>
                                            <?=empty($user['details']['md_mon_salary']) ? '未知':$user['details']['md_mon_salary'] ?>
                                            <label style="color: #0b58a2;margin-left: 10px">年 薪：</label><i style="color: #0b58a2;margin-left: 5px" class="fa fa-rmb"></i>
                                            <?=empty($user['details']['md_year_salary']) ? '未知':$user['details']['md_year_salary'] ?>
                                            </div>
                                            <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">健康状况：</label>
                                            <label style="color: #0b58a2;margin-left: 5px">遗传病：</label><?=empty($user['healths']['mh_syntrophus']) ? '未知':$user['healths']['mh_syntrophus'] ?>
                                            <label style="color: #0b58a2;margin-left: 5px">病 种：</label><?=empty($user['healths']['mh_history']) ? '未知':$user['healths']['mh_history'] ?>
                                            </div>
                                            <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">当前状况：</label>
                                            <i style="color: #0b58a2;margin-left: 5px" class="fa fa-home"></i> &nbsp;<?=empty($user['details']['md_isowner']) ?
                                            '未知':($user['details']['md_isowner'] == '无')? '<i class="fa fa-times"></i>':'<i class="fa fa-check"></i>' ?>
                                            <i style="color: #0b58a2;margin-left: 10px" class="fa fa-car"></i> &nbsp;<?=empty($user['details']['md_hascar']) ?
                                            '未知':($user['details']['md_hascar'] == '无')? '<i class="fa fa-times"></i>':'<i class="fa fa-check"></i>' ?>
                                            <i style="color: #0b58a2;margin-left: 10px" class="fa fa-paypal"></i> &nbsp;<?=empty($user['details']['md_loan']) ?
                                            '未知':($user['details']['md_loan'] == '无')? '<i class="fa fa-times"></i>':'<i class="fa fa-check"></i>' ?>
                                            <i style="color: #0b58a2;margin-left: 10px" class="fa fa-child"></i> &nbsp;<?=empty($user['details']['md_child']) ?
                                            '未知':($user['details']['md_child'] == '无')? '<i class="fa fa-times"></i>':'<i class="fa fa-check"></i>' ?>
                                            <?php
                                            if(!empty($user['details'])&&$user['details']['md_marry']=='离异'){
                                            ?>
                                            <label style="color: #0b58a2;margin-left: 10px">离婚证号：</label>
                                            <?=empty($user['details']['md_despid']) ? '未知':$user['details']['md_despid'] ?>
                                            <?php
                                            }
                                            ?>
                                            </div>
                                            <div class="row">
                                            <?php
                                            if(!empty($user['details'])&&$user['details']['md_isowner']=='有'){
                                            ?>
                                            <label style="color: #0b58a2;margin-left: 10px">房屋地址：</label><i style="color: #0b58a2;margin-left: 10px" class="fa fa-map-marker"></i>&nbsp;
                                            <?=empty($user['details']['md_location'])&&empty($user['details']['md_house_address']) ? '未知':str_replace(';','',$user['details']['md_location']).$user['details']['md_house_address'] ?>
                                            <label style="color: #0b58a2;margin-left: 10px">房屋面积：</label>
                                            <?=empty($user['details']['md_house_area']) ? '未知':$user['details']['md_house_area'].'㎡' ?>
                                            <?php
                                            }
                                            ?>
                                            </div>
                                            <div class="row">
                                            <?php
                                            if(!empty($user['details'])&&$user['details']['md_child']=='有'){
                                            ?>
                                            <label style="color: #0b58a2;margin-left: 10px">小孩归属：</label> &nbsp;
                                            <?=empty($user['details']['md_child_belong']) ? '未知':$user['details']['md_child_belong'] ?>
                                            <?php
                                            }
                                            if(!empty($user['details'])&&$user['details']['md_hascar']=='有'){
                                            ?>
                                            <label style="color: #0b58a2;margin-left: 10px">&nbsp;&nbsp; 车 &nbsp;型&nbsp;&nbsp;：</label>
                                            <?=empty($user['details']['md_cartype']) ? '未知':$user['details']['md_cartype'] ?>
                                            <?php
                                            }

 ?>
                                            </div>
                                            <div class="row">
                                            <label style="color: #0b58a2;margin-left: 10px">自我描述：</label> &nbsp;
                                            <?=empty($user['details']['md_selfdiscr']) ? '无':$user['details']['md_selfdiscr'] ?>
                                            </div>
                                            </div>
                                            <?php
$pic =(empty($user->photos)||empty($user->photos->mp_main)) ?
    Yii::$app->params['img_path'].'photo/users/user-default.jpg':
    Yii::$app->params['img_path'].$user->photos->mp_main;
 ?>
                                            <div class="col-sm-5">
                                            <div class="lightBoxGallery">
                        <a href="<?=$pic ?>" title="正面照" data-gallery=""><img style="height: 180px" id="main_photo" src="<?=$pic ?>"></a>
                        <div id="blueimp-gallery" class="blueimp-gallery">
                            <div class="slides"></div>
                            <h3 class="title"></h3>
                            <a class="prev"><</a>
                            <a class="next">></a>
                            <a class="close">×</a>
                            <a class="play-pause"></a>
                            <ol class="indicator"></ol>
                        </div>
                    </div>
                    </div>
                                            </div>
                                            </td>
                                        </tr>
                                    <?php endforeach;?>
                                    </tbody>
                                </table>
                                <!--分页-->
                                <div class="f-r" style="text-align: center">
                                    <?= LinkPager::widget([
                                        'pagination'=>$pages,
                                        'class'=>'.pagination-sm',
                                        'linkOptions' => ['onclick' => 'return goPage(this)'],
                                        'firstPageLabel' => '首页',
                                        'nextPageLabel' => '下一页',
                                        'prevPageLabel' => '上一页',
                                        'maxButtonCount' => 8,
                                        'lastPageLabel' => '末页',
                                    ]) ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <style>
        .datepicker {
        z-index: 9999 !important;
        }
    </style>
    <div class="modal inmodal fade" id="myDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg" >
            <?php $form = ActiveForm::begin([
                'id'=>'user_info',
                'action' => Url::toRoute('user/create'),
                'enableAjaxValidation'=>true, //开启Ajax验证
                'validationUrl' => Url::toRoute('user/valid-form'),
            ]); ?>
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title"><i class="fa fa-table"></i> 新增客户</h4>
                    <small class="font-bold">此处填写用户的基本信息，详细信息请前往详细页面编辑</small>
                </div>
                <div class="modal-body">
                <div id="base_info">
                <h3 style="color: #00a2d4;">基本信息</h3>
                <div class="row">
                <div class="col-sm-3">
                <?= $form->field($info,'mi_name')->textInput(['maxlength'=>true])->label('姓 名') ?></div>
                <div class="col-sm-2">
                    <?= $form->field($info,'mi_sex')->radioList(['男'=>'男','女'=>'女'])->label('性 别') ?></div>
                    <div class="col-sm-2">
                        <?= $form->field($info,'mi_height')->textInput([
                        'onkeyup'=>'this.value=this.value.replace(/\D/gi,"")',
                        'placeholder'=>'单位：cm'
                    ])->label('身 高') ?>
                    </div>
                    <div class="col-sm-2">
                    <?= $form->field($info,'mi_weight')->textInput([
                        'onkeyup'=>'clearNoNum(this)',
                        'placeholder'=>'单位：kg'])->label('体 重') ?></div>
                        </div>
                    <div class="row">
                    <div class="col-sm-3">
                    <?=$form->field($info, 'mi_birth')->widget(
                            DatePicker::className(), [
                            'value' => date('yyyy年mm月',time()),
                            // inline too, not bad
                            'inline' => false,
                            'language'=>'zh-CN',
                            'options'=>[
                                'readonly'=>true,
                            ],
                            // modify template for custom rendering
                            'clientOptions' => [
                                'autoclose' => true,
                                'minViewMode'=>1,
                                'keyboardNavigation'=>false,
                                'forceParse'=>false,
                                'format' => 'yyyy年mm月',
                                'readonly'=>true,
                            ]
                        ]); ?>
                    </div><div class="col-sm-2">
                    <?= $form->field($info,'mi_zodiac')->textInput(['readonly'=>true,'value'=>$arr[(date('Y',time())%12)],'style'=>'width:100px'])->label('属 相') ?>
                    </div><div class="col-sm-2">
                    <?= $form->field($info,'mi_edu')->dropDownList([
                        '博士'=>'博士','硕士'=>'硕士','本科'=>'本科','大专'=>'大专','高中'=>'高中','初中'=>'初中','文盲'=>'文盲'
                    ],[
                        'prompt'=>'请选择学历'])->label('学 历') ?>
                    </div><div class="col-sm-2">
                            <?= $form->field($detail,'md_marry')->dropDownList([
                        '未婚'=>'未婚','离异'=>'离异','丧偶'=>'丧偶'
                    ]) ?>
                        </div>
                    </div>
                    <div class="row">
                    <div class="col-sm-5">
                    <div class="form-group">
                    <div class="row" style="margin-top: 0px;margin-bottom: 0px">
                    <div style="display: none;margin-top: 0px;margin-bottom: 0px">
                    <?= $form->field($info,'mi_root')->hiddenInput() ?></div>
                        <div class="col-sm-12" style="margin-top: 0px;margin-bottom: 0px">
                        <label class="control-label">籍 贯</label>
                            </div>
                        </div>
                        <div class="row" style="margin-top: 0px;margin-bottom: 0px">
                        <div class="col-sm-6" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="info_privince" class="form-control" name="info_privince">
                            <?php
                            foreach($privinces as $key=>$val){
                             ?>
                             <option value="<?=$key ?>" <?php if($key==320000){echo 'selected';} ?>><?=$val ?></option>
                              <?php
                            } ?>
                            </select></div><div class="col-sm-6" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="info_city" class="form-control" name="info_city">
                            <?php
                            foreach($cities as $key=>$val){
                             ?>
                             <option value="<?=$key ?>"><?=$val ?></option>
                              <?php
                            } ?>
                            </select></div></div>
                    </div>
                    </div>
                    <div class="col-sm-3">
                    <?= $form->field($info,'mi_cardid')->textInput(['maxlength'=>true,'onkeyup'=>'this.value=this.value.replace(/\D/gi,"")']) ?></div>
                    <div class="col-sm-3">
                    <?= $form->field($info,'mi_sight')->dropDownList([
                        '正常'=>'正常','近视'=>'近视','轻度近视'=>'轻度近视','高度近视'=>'高度近视','远视'=>'远视','盲人'=>'盲人'
                    ],[
                        'value'=>'正常']) ?>
                    </div>
                    </div>
                    <div class="row">
                    <div class="col-sm-3">
                    <?= $form->field($health,'mh_state')->dropDownList([
                        '健康'=>'健康','亚健康'=>'亚健康','非健康'=>'非健康'
                    ],[
                        'value'=>'健康']) ?>
                    </div>
                    <div class="col-sm-3">
                    <?= $form->field($health,'mh_history')->radioList(['有'=>'有','无'=>'无'],['id'=>'detail_child']) ?></div>
                    <div class="col-sm-3">
                    <?= $form->field($health,'mh_syntrophus')->radioList(['有'=>'有','无'=>'无'],['id'=>'detail_child']) ?>
                    </div>
                    </div>
                    </div>
                    <div id="contact_ways">
                    <h3 style="color: #00a2d4">联系方式</h3>
                    <div class="row">
                    <div class="col-sm-12">
                    <div class="form-group">
                    <div class="row" style="margin-top: 0px;margin-bottom: 0px">
                    <div style="display: none;margin-top: 0px;margin-bottom: 0px">
                    <?= $form->field($extra,'me_postion')->hiddenInput() ?></div>
                        <div class="col-sm-12" style="margin-top: 0px;margin-bottom: 0px">
                        <label class="control-label">现居地</label>
                            </div>
                        </div>
                        <div class="row" style="margin-top: 0px;margin-bottom: 0px">
                        <div class="col-sm-3" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="extra_privince" class="form-control" name="extra_privince">
                            <?php
                            foreach($privinces as $key=>$val){
                             ?>
                             <option value="<?=$key ?>" <?php if($key==320000){echo 'selected';} ?>><?=$val ?></option>
                              <?php
                            } ?>
                            </select></div><div class="col-sm-3" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="extra_city" class="form-control" name="extra_city">
                            <?php
                            foreach($cities as $key=>$val){
                             ?>
                             <option value="<?=$key ?>" <?php if($key==320400){echo 'selected';} ?>><?=$val ?></option>
                              <?php
                            } ?>
                            </select></div><div class="col-sm-3" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="extra_district" class="form-control" name="extra_district">
                            <?php
                            foreach($districts as $key=>$val){
                             ?>
                             <option value="<?=$key ?>"><?=$val ?></option>
                              <?php
                            } ?>
                            </select></div>
                            <div class="col-sm-3">
                                <?= $form->field($extra,'me_address')->textInput(['placeholder'=>'请输入详细地址'])->label(false) ?></div>
                        </div>
                    </div>
                    </div>
                    </div>
                    <div class="row">
                    <div class="col-sm-3">
                    <?= $form->field($extra,'me_phone')->textInput(['maxlength'=>true,'onkeyup'=>'this.value=this.value.replace(/\D/gi,"")']) ?></div><div class="col-sm-3">
                    <?= $form->field($extra,'me_qq')->textInput(['maxlength'=>true,'onkeyup'=>'this.value=this.value.replace(/\D/gi,"")']) ?></div><div class="col-sm-3">
                    <?= $form->field($extra,'me_wx')->textInput() ?></div>
                    </div>
                        </div>
                        <div id="user_detail">
                    <h3 style="color: #00a2d4">现 状</h3>
                    <div class="row"><div class="col-sm-4">
                    <?= $form->field($detail,'md_work')->textInput() ?></div><div class="col-sm-2">
                    <?= $form->field($detail,'md_mon_salary')->textInput(['onkeyup'=>'clearNoNum(this)',
                        'placeholder'=>'单位：元'])->label('月 薪') ?></div><div class="col-sm-2">
                    <?= $form->field($detail,'md_year_salary')->textInput(['onkeyup'=>'clearNoNum(this)',
                        'placeholder'=>'单位：元'])->label('年 薪') ?></div>
                    </div>
                    <div class="row"><div class="col-sm-3">
                    <?= $form->field($extra,'me_env')->dropDownList([
                    '独居'=>'独居','与亲人住一起'=>'与亲人住一起','与朋友合租'=>'与朋友合租','与陌生人合租'=>'与陌生人合租'
                        ]) ?></div><div class="col-sm-3">
                    <?= $form->field($extra,'me_livetype')->dropDownList([
                    '住房'=>'住房','存量房'=>'存量房','商品房'=>'商品房'
                    ]) ?></div>
                    <div class="col-sm-2">
                    <div class="form-group">
                    <div style="margin-top: 30px"><label><input id="md_isowner" value="0" type="checkbox"> 有 房</label></div>
                    </div>
                    </div>
                    <div class="col-sm-2">
                    <div class="form-group">
                    <div style="margin-top: 30px"><label><input id="md_hascar" value="0" type="checkbox"> 有 车</label></div>
                    </div>
                    </div>
                    <div class="col-sm-2">
                    <div class="form-group">
                    <div style="margin-top: 30px"><label><input id="md_loan" value="0" type="checkbox"> 有贷款</label></div>
                    </div>
                    </div>
                    <div style="display: none;margin-top: 0px;margin-bottom: 0px">
                    <?= $form->field($detail,'md_isowner')->hiddenInput() ?>
                    <?= $form->field($detail,'md_hascar')->hiddenInput() ?>
                    <?= $form->field($detail,'md_loan')->hiddenInput() ?></div>
                    </div>
                    <div class="row">
                    <div class="col-sm-12" id="house_location" style="display:none;">
                    <div class="form-group">
                    <div class="row" style="margin-top: 0px;margin-bottom: 0px">
                    <div style="display: none;margin-top: 0px;margin-bottom: 0px">
                    <?= $form->field($detail,'md_location')->hiddenInput() ?></div>
                        <div class="col-sm-12" style="margin-top: 0px;margin-bottom: 0px">
                        <label class="control-label">房屋地区</label>
                            </div>
                        </div>
                        <div class="row" style="margin-top: 0px;margin-bottom: 0px">
                        <div class="col-sm-4" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="detail_privince" class="form-control" name="detail_privince">
                            <option value="0" selected>请选择省份</option>
                            <?php
                            foreach($privinces as $key=>$val){
                             ?>
                             <option value="<?=$key ?>"><?=$val ?></option>
                              <?php
                            } ?>
                            </select></div><div class="col-sm-4" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="detail_city" class="form-control" name="detail_city">
                             <option value="0" disabled selected>请先选择省份</option>
                            </select>
                            </div>
                            <div class="col-sm-4" style="margin-top: 0px;margin-bottom: 0px">
                            <select id="detail_district" class="form-control" name="detail_district">
                            <option value="0" disabled selected>请先选择省份</option>
                            </select>
                            </div>
                        </div>
                    </div>
                    </div>
                    </div>
                            <div class="row">
                                <div class="col-sm-4" id="house_address" style="display: none">
                                    <?= $form->field($detail,'md_house_address')->textInput([
                                        'placeholder'=>'请输入房屋详细地址']) ?>
                                </div>
                                <div class="col-sm-2" id="house_area" style="display: none">
                                    <?= $form->field($detail,'md_house_area')->textInput([
                                        'onkeyup'=>'clearNoNum(this)',
                                        'placeholder'=>'单位：㎡']) ?>
                                </div>
                            </div>
                     <div class="row">
                         <div class="col-sm-2" id="car_type" style="display: none">
                             <?= $form->field($detail,'md_cartype')->textInput([
                                 'placeholder'=>'如：奥迪A3'])->label('车 型') ?>
                         </div>
                     <div class="col-sm-3" style="display: none" id="md_despid">
                    <?= $form->field($detail,'md_despid')->textInput() ?></div>
                    <div class="col-sm-2" style="display: none" id="md_child">
                    <?= $form->field($detail,'md_child')->radioList(['有'=>'有','无'=>'无'],['id'=>'detail_child']) ?></div>
                     <div class="col-sm-3" style="display: none" id="md_child_belong">
                    <?= $form->field($detail,'md_child_belong')->dropDownList([
                    '己方'=>'己方','对方'=>'对方','他人'=>'他人'
                    ],['prompt'=>'请选择小孩归属']) ?></div>
                    </div>
                    <div class="row">
                    <div class="col-sm-12">
                    <?= $form->field($detail,'md_selfdiscr')->textarea(['maxlength'=>true,'placeholder'=>'最多100字','rows'=>3]) ?></div>
                    </div>
                    </div>
                    </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
                </div>
            </div>

            <?php ActiveForm::end(); ?>
        </div>
    </div>
<?=Html::jsFile('@web/js/marriage/user.js?_'.time())?>